home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
General
/
ViewIt™ 2.24 Shareware
/
C++ Demo Projects
/
Metrowerks C++ 1.0a4 Demos
/
fDemoMC+.cp
< prev
next >
Wrap
Text File
|
1994-03-02
|
3KB
|
145 lines
/* FaceIt 2.2 Demonstration Program */
/* ©FaceWare 1989-94. All Rights Reserved. */
/*C1 - run program to see on-line comments */
/*C2*/
#include "string.h"
#include "FaceStorMC+.h"
extern struct FaceRec fRec;
short i,mode;
long oldCount,newCount;
KeyMap keys;
char fileName[256];
void main()
{
/*C3*/
strcpy(fRec.uName, "fDemo.Rsrc");
/*C4*/
FaceIt(0,DoInit,3);
/*C5*/
FaceIt(0,NewWnd,1010,1);
FaceIt(0,NewWnd,1020,1);
/*C6*/
FaceIt(0,NewWnd,1030,1);
/*C7*/
FaceIt(0,NewWnd,1040,2);
/*C8*/
for (;;)
{
FaceIt(0,DoLoop);
/*C9*/
switch (fRec.uMenuID)
{
/*C10*/
case 101:
if (fRec.uMenuItem == 1) {
strcpy(fRec.uString, "Demonstration of the use of FaceIt\rto support program-wide features.");
FaceIt(0,ShoStr,3,12,(1L + (409L * 65536L)));
}
break;
/*C11*/
case 102:
if (fRec.uMenuItem == 6) {
FaceIt(0,GetWVC,1010);
FaceIt(0,SavWnd,1010);
FaceIt(0,GetWVC,1020);
FaceIt(0,SavWnd,1020);
FaceIt(0,GetWVC,1040);
FaceIt(0,SavWnd,1040);
}
break;
/*C12*/
case 105:
case 106:
case 1030:
case 1040:
switch (fRec.uMenuItem)
{
case 1:
SysBeep(5);
break;
case 2:
SysBeep(5);
SysBeep(5);
break;
case 3:
SysBeep(5);
SysBeep(5);
SysBeep(5);
break;
/*C13*/
case 4:
FaceIt(0,GetCtl,1030,0,1,4);
FaceIt(0,PopMen,107,fRec.cRect.top - 9,fRec.cRect.left - 10);
break;
/*C14*/
case 8:
/*C15*/
FaceIt(0,ShoAlt,1010,0,1,1);
mode = fRec.uResult;
oldCount = 0L;
if (mode > 1)
for (;;)
{
/*C16*/
newCount = TickCount();
if (newCount - oldCount > 180)
{
SysBeep(5);
oldCount = newCount;
}
/*C17*/
if (mode == 2)
if (GetNextEvent(-1,&fRec.fEvent))
if (fRec.fEvent.what == 5)
break;
else
FaceIt(0,DoEvnt);
/*C18*/
if (mode == 3)
{
GetKeys((long*)&keys);
if ((BitTst(&keys,61L))&&(BitTst(&keys,48L)))
{
FlushEvents(62,0);
break;
}
}
}
break;
}
break;
/*C19*/
case 1100:
if (fRec.uMenuItem == 2)
{
if (fRec.fActiveWnd == 0L)
strcpy(fRec.uString, "No Window");
else if (fRec.fActiveID != 1200)
strcpy(fRec.uString, "Non-ViewIt Window");
else if (fRec.fActiveResID == 1204)
strcpy(fRec.uString, "Help Window");
else if (fRec.fActiveResID == 1010)
strcpy(fRec.uString, "Editor Window");
else if (fRec.fActiveResID == 1020)
strcpy(fRec.uString, "Clipboard Window");
else if (fRec.fActiveResID == 1030)
strcpy(fRec.uString, "Beeps Window");
FaceIt(0,SetItm2,105,10,3,0);
}
/*C20*/
else if (fRec.uMenuItem == 512)
if (strcmp(fRec.uString,"TEXT") == 0)
if (fRec.uResult == 1)
{
strcpy(fileName,fRec.uName);
FaceIt(0,GetCtl,1010,0,1,1);
strcpy(fRec.uName,fileName);
FaceIt(fRec.cControl,1551,0,1); /* OpnCTxt */
}
break;
}
}
}